/**
 * 
 */
package ivan.cheng.tuqu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

/**
 * 
 * @author ivan
 *
 */
public class GridToolAdapter extends BaseAdapter{

	/**
	 * 
	 */
	private Context mContext;
	public static final int miIconCount = 10;// 
	public GridToolAdapter(Context _context) {
		mContext = _context;
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return miIconCount;
	}

	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		ImageView i;

        if (convertView == null) {
            i = new ImageView(mContext);
            i.setScaleType(ImageView.ScaleType.CENTER);
            i.setLayoutParams(new Gallery.LayoutParams(
            		LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        } else {
            i = (ImageView) convertView;
        }
        //i.setImageResource(R.drawable.face01);
        return i;
	}

}
